Extension:Cargo
リリースの状態: 安定 |
|
|---|---|
| 実装 | 特別ページ, API, パーサー関数 |
| 説明 | テンプレートに含まれるデータを格納できるようにし、データのクエリを実行できるようにする拡張機能。 |
| 作者 | Yaron Koren <yaron57@gmail.com> (Yaron Korenトーク) |
| 最新バージョン | 3.9.4 (2026年8月) |
| 互換性の方針 | master が後方互換性を維持しています。 |
| MediaWiki | 1.42+ |
| データベースの変更 | はい |
| Composer | mediawiki/cargo |
|
|
|
|
|
|
| ライセンス | GNU 一般公衆利用許諾書 2.0 以降 |
| ダウンロード | |
| 例 | Wikimedia Australia's Cargo Tables |
| Cargo 拡張機能の翻訳にご協力ください | |
| 問題点 | 未解決のタスク · バグを報告 |
Cargo は MediaWiki 拡張機能であり、テンプレート呼び出しに含まれるデータを格納したり、データのクエリを実行したりできる軽量な方法を提供します。 概念は Semantic MediaWiki 拡張機能に似ていますが、インストールの容易さや使いやすさなど、多くの利点があります。
Cargoはデータをデータベース テーブルに格納します。そのデータベース テーブルは(既定で)MediaWikiのデータベース、または別のデータベースに配置できます。 ほとんどの場合は、格納されるテンプレートのデータは独自のDBテーブルに保存されます。そのなかの列は一つのテンプレート パラメータに関連付けられます。 しかし、例外も存在します。多数のDBシステムでは値の配列・リストがあるテンプレート フィールドと地理座標があるフィールドをうまく処理できないため、これらのデータの処理はより複雑になります。 複数のテンプレートのデータは、単一のDBテーブルに保存できます。
The extension defines a number of parser functions; these three are the most important:
#cargo_declare– placed within the<noinclude>part of a template; it defines the schema for a table.#cargo_store– stores one row to a Cargo table; usually placed within the<includeonly>part of a template.#cargo_query– queries one or more Cargo data tables, using SQL components.
The other defined parser functions are:
#cargo_attach– 他の場所で宣言されたテーブルに行を追加するようにテンプレートを定義します。#cargo_compound_query– displays the results of multiple queries in one place.#cargo_display_map– displays a map showing a single point.#recurring_event– prints out the dates for a recurring event; for use by #cargo_store.
Cargo also defines various interfaces for viewing and drilling down through this stored data. As such, it adds the following special pages:
- Special:CargoQuery
- Special:CargoTableDiagram
- Special:CargoTables
- Special:Drilldown
Cargo has been tested, and works, with the MySQL and PostgreSQL database systems. In theory, it also supports SQLite, but it has not been well-tested with SQLite and may not work.
This version of the Cargo extension requires MediaWiki 1.42+.
Below are links to the entire documentation.
- Download and installation
How to download Cargo via either Git, a standard download, or a software package; and how to install it. - Quick start guide
A short guide to generate Cargo-based templates and Cargo tables, especially in conjunction with the Page Forms extension. - Other documentation
Links to other forms of documentation - SMW migration guide
A guide for modifying templates and queries that use Semantic MediaWiki to switch to Cargo instead. - Storing data
Using #cargo_declare, #cargo_attach and #cargo_store to create and populate Cargo tables. - Querying data
Querying Cargo data with #cargo_query, #cargo_compound_query and other tools. - Display formats
The various display formats available, including lists, charts, maps and calendars. - Browsing data
Browsing the Cargo data using the built-in tools: Special:Drilldown, Special:CargoQuery, Special:CargoTables - Exporting data
Exporting Cargo data into output formats including: CSV, JSON, RSS - Other features
Other features of Cargo, including displaying maps and making use of Lua. - Common problems
Common issues that people have run into. - Known bugs and planned features
Known bugs in the software, and potential workarounds for them; plus features that are planned in the current development roadmap. - Getting support
Where to ask questions, submit bug reports, submit feature requests, submit fixes, and add new translations. - Authors and credits
The main authors, others who have contributed to the code, and credits to other organizations and software projects. - Version history
The release history of Cargo. - Sites that use Cargo
A small sampling of the wikis that use Cargo. - Cargo and Semantic MediaWiki
A comparison of Cargo to its main alternative, Semantic MediaWiki, in terms of both features and performance. - FAQ
Frequently-asked questions.
設定
Below are Cargo's global configuration settings along with their default values.
To configure Cargo to use a separate database instead of the MediaWiki database, the following settings are provided:
| Separate database configuration settings | ||
|---|---|---|
| 設定 | 既定 | 説明 |
$wgCargoDBtype
|
null
|
Database type. |
$wgCargoDBserver
|
null
|
Host name or IP address of database server. |
$wgCargoDBname
|
null
|
Name of the database. |
$wgCargoDBuser
|
null
|
Database username. |
$wgCargoDBpassword
|
null
|
The password for $wgCargoDBuser.
|
$wgCargoDBprefix
|
null
|
Database table name prefix. |
$wgCargoDBRowFormat
|
null
|
Database row format. |
$wgCargoDBTableOptions
|
null
|
Comma-separated options, analogous to $wgDBTableOptions. |
For character configuration as related to numbers, the following configuring settings are provided:
| Character configuration settings | ||
|---|---|---|
| 設定 | 既定 | 説明 |
$wgCargoDecimalMark
|
.
|
Decimal character for numbers. |
$wgCargoDigitGroupingCharacter
|
,
|
Thousands digit separator. |
The remaining global configuration settings are as follows:
| 設定 | 既定 | 説明 |
|---|---|---|
$wgCargoAllowedSQLFunctions
|
[1] | Sets allowed SQL functions. |
$wgCargoRecurringEventMaxInstances
|
100 | The number of max instances to store for recurring events with no set end date. |
$wgCargoDefaultStringBytes
|
300 | The default number of characters for fields of type Page, String, Wikitext string, File, URL, Email
|
$wgCargoDefaultQueryLimit
|
100 | Number of results to show for #cargo_query if no limit is set
|
$wgCargoMaxQueryLimit
|
5000 | The maximum allowed number of results for #cargo_query
|
$wgCargoQueryMaxExecutionTime
|
null | The maximum amount of time (in milliseconds) that Cargo queries can run before they are stopped (MySQL/MariaDB only) |
$wgCargo24HourTime
|
false
|
If true uses 24-hour time for Datetime field types.
|
$wgCargoDefaultMapService
|
OpenLayers | Sets the default map service to Google Maps, if set to googlemaps, to Leaflet if set to leaflet, and to OpenLayers if set to openlayers.
|
$wgCargoGoogleMapsKey
|
null
|
API key for Google Maps, for the googlemaps display format.
|
$wgCargoMapClusteringMinimum
|
80 | If the number of map points displayed is greater than the value of $wgCargoMapClusteringMinimum, the map displays the locations in "clusters" instead of individual points, for readability. If set to a very high number, does not display clustering. |
$wgCargoDrilldownUseTabs
|
true
|
Displays Special:Drilldown table names as tabs at the top instead of a vertical list at the side. |
$wgCargoDrilldownSmallestFontSize
|
-1 | If set to a positive number, sets the smallest font size, in pixels, for a tag-cloud-style display of filter values. |
$wgCargoDrilldownLargestFontSize
|
-1 | If set to a positive number, sets the largest font size, in pixels, for a tag-cloud-style display of filter values. |
$wgCargoDrilldownMinValuesForComboBox
|
40 | Sets the minimum number of values before their display is converted to a combo box, instead of individual links. |
$wgCargoDrilldownNumRangesForNumbers
|
5 | For fields/filters of type Integer or Float, specifies the number of "buckets" into which values are divided.
|
$wgCargoMaxVisibleHierarchyDrilldownValues
|
30 | If set to a positive integer, specifies the maximum number of values shown at a time for any hierarchy field (All the top-level values are shown irrespective of this value). The values are hidden beyond a certain depth of the hierarchy such that the count of total visible values is at most this number.
|
$wgCargoTablesPrioritizeReplacements
|
false
|
If true, all tables having a replacement appear at the top of the Special:CargoTables page, instead displaying them in alphabetical order.
|
$wgCargoPageDataColumns
|
[] | The set of fields to store in the _pageData Cargo table. See Storing page data.
|
$wgCargoFileDataColumns
|
[] | The set of fields to store in the _fileData Cargo table. See Storing file data.
|
$wgCargoHideNamespaceName
|
[6] | Array of namespaces to hide from query results. |
$wgCargoLegacyNullLuaFieldsAsEmptyString
|
false
|
Null results to the Lua Cargo query function should return as string rather than nil. This allows you to rollback a breaking change from early 2022. New wikis created after this time should not enable this. |
$wgCargoStoreUseTemplateArgsFallback
|
true
|
Enable the behavior that looks for template arguments that match the template's declared table to fill columns. |
関連項目
- Manual:MediaWikiのデータ管理法 – An overview and comparison of data management extensions
| この拡張機能は以下のウィキ ファーム/ウィキ ホスト/パッケージに含まれています: |
- ↑ See Using SQL Functions for defaults.
- Stable extensions/ja
- Special page extensions/ja
- API extensions/ja
- Parser function extensions/ja
- Extensions supporting Composer/ja
- AdminLinks extensions/ja
- ApprovedRevsRevisionApproved extensions/ja
- ApprovedRevsRevisionUnapproved extensions/ja
- CategoryAfterPageAdded extensions/ja
- CategoryAfterPageRemoved extensions/ja
- LinksUpdate extensions/ja
- LoadExtensionSchemaUpdates extensions/ja
- MakeGlobalVariablesScript extensions/ja
- PageDeleteComplete extensions/ja
- PageForms::TemplateFieldEnd extensions/ja
- PageForms::TemplateFieldStart extensions/ja
- PageMoveComplete extensions/ja
- PageSaveComplete extensions/ja
- PageSchemasRegisterHandlers extensions/ja
- ParserFirstCallInit extensions/ja
- ResourceLoaderGetConfigVars extensions/ja
- ScribuntoExternalLibraries extensions/ja
- SidebarBeforeOutput extensions/ja
- SkinTemplateNavigation::Universal extensions/ja
- UploadComplete extensions/ja
- GPL licensed extensions/ja
- Extensions in Wikimedia version control/ja
- All extensions/ja
- Extensions included in Canasta/ja
- Extensions included in Fandom/ja
- Extensions included in Miraheze/ja
- Extensions included in MyWikis/ja
- Extensions included in wiki.gg/ja
- Data extraction extensions/ja
- Database extensions/ja
- Table extensions/ja
- Calendar extensions/ja
- Map extensions/ja
- Google Maps extensions/ja
- OpenLayers extensions/ja
- Leaflet extensions/ja
- Graphical Timelines/ja
- Graph extensions/ja
- Math extensions/ja
- Search extensions/ja
- Data management extensions/ja
