Extension:Cargo/pl

Category:GPL licensed extensions/pl
Podręcznik rozszerzeń MediaWiki
Cargo
Status wydania: stabilneCategory:Stable extensions/pl
Realizacja Strona specjalna Category:Special page extensions/pl, API Category:API extensions/pl, Funkcja parsera Category:Parser function extensions/pl
Opis An extension that allows for the storage and querying of data contained within templates.
Autor(zy) Yaron Koren <yaron57@gmail.com> (Yaron Korendyskusja)
Ostatnia wersja 3.8 (kwiecień 2025)
Polityka zgodności Master utrzymuje kompatybilność wsteczną.
MediaWiki 1.40+Category:Extensions with manual MediaWiki version
Zmiany w bazie danych Tak
Composer mediawiki/cargoCategory:Extensions supporting Composer/pl
Tabele cargo_tables
cargo_pages
cargo_backlinks
Licencja Licencja GNU General Public License 2.0 lub nowsza
Pobieranie Category:Extensions in Wikimedia version control/pl
Przykład A page containing various calls to #cargo_query
  • $wgCargoFileDataColumns
  • $wgCargoDrilldownLargestFontSize
  • $wgCargoDecimalMark
  • $wgCargoDefaultStringBytes
  • $wgCargoAllowedSQLFunctions
  • $wgCargoHideNamespaceName
  • $wgCargoPageDataColumns
  • $wgCargoIgnoreBacklinks
  • $wgCargoMaxVisibleHierarchyDrilldownValues
  • $wgCargoDrilldownSmallestFontSize
  • $wgCargoLegacyNullLuaFieldsAsEmptyString
  • $wgCargoRecurringEventMaxInstances
  • $wgCargoDefaultMapService
  • $wgCargoStoreUseTemplateArgsFallback
  • $wgCargoTablesPrioritizeReplacements
  • $wgCargoMaxQueryLimit
  • $wgCargoDigitGroupingCharacter
  • $wgCargoDefaultQueryLimit
  • $wgCargoDrilldownNumRangesForNumbers
  • $wgCargo24HourTime
  • $wgCargoDrilldownUseTabs
  • $wgCargoMapClusteringMinimum
  • $wgCargoDrilldownMinValuesForComboBox
  • recreatecargodata
  • deletecargodata
  • runcargoqueries
Quarterly downloads 61 (Ranked 56th)
Translate the Cargo extension
Problemy Otwarte zadania · Zgłoś błąd
Category:All extensions/pl

Cargo is an extension to MediaWiki that provides a lightweight way to store and query the data contained within the calls to templates, such as infoboxes. It is similar in concept to the Semantic MediaWiki extension, but offers a number of advantages, including ease of installation and ease of use.

Cargo stores all its data in database tables, which can be placed in either MediaWiki's own database (the default) or a separate database. For the most part, each stored template gets its data stored in a single DB table, with a column for each relevant template parameter. There are a few exceptions to this: the handling of template fields that hold arrays/lists of values, and of fields that hold geographical coordinates, is more complex, due to poor native handling of those data types in most DB systems. And multiple templates can be set to all store their data in one DB table.

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 - defines a template as adding rows to a table declared elsewhere.
  • #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.38+.

Click through the pages in the navigation bar above to learn more about Cargo, how it works, how to use it, and how to install it.

Instalacja

Konfiguracja

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
Setting Default Description
$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 Data base row format.

For character configuration as related to numbers, the following configuring settings are provided:

Character configuration settings
Setting Default Description
$wgCargoDecimalMark . Decimal character for numbers.
$wgCargoDigitGroupingCharacter , Thousands digit separator.

The remaining global configuration settings are as follows:

Setting Default Description
$wgCargoAllowedSQLFunctions [] Sets allowed SQL functions. See Using SQL Functions for defaults.
$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
$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.


Zobacz też

Category:Data extraction extensions/pl Category:Database extensions/pl Category:Table extensions/pl Category:Calendar extensions/pl Category:Map extensions/pl Category:Google Maps extensions/pl Category:OpenLayers extensions/pl Category:Leaflet extensions/pl Category:Graphical Timelines/pl Category:Graph extensions/pl Category:Math extensions/pl Category:Search extensions/pl Category:Data management extensions/pl
Category:API extensions/pl Category:AdminLinks extensions/pl Category:All extensions/pl Category:ApprovedRevsRevisionApproved extensions/pl Category:ApprovedRevsRevisionUnapproved extensions/pl Category:Calendar extensions/pl Category:CategoryAfterPageAdded extensions/pl Category:CategoryAfterPageRemoved extensions/pl Category:Data extraction extensions/pl Category:Data management extensions/pl Category:Database extensions/pl Category:Extensions in Wikimedia version control/pl Category:Extensions included in Canasta/pl Category:Extensions included in Fandom/pl Category:Extensions included in Miraheze/pl Category:Extensions included in MyWikis/pl Category:Extensions included in WikiForge/pl Category:Extensions included in wiki.gg/pl Category:Extensions supporting Composer/pl Category:Extensions with manual MediaWiki version Category:GPL licensed extensions/pl Category:Google Maps extensions/pl Category:Graph extensions/pl Category:Graphical Timelines/pl Category:Leaflet extensions/pl Category:LinksUpdate extensions/pl Category:LoadExtensionSchemaUpdates extensions/pl Category:MakeGlobalVariablesScript extensions/pl Category:Map extensions/pl Category:Math extensions/pl Category:OpenLayers extensions/pl Category:PageDeleteComplete extensions/pl Category:PageForms::TemplateFieldEnd extensions/pl Category:PageForms::TemplateFieldStart extensions/pl Category:PageMoveComplete extensions/pl Category:PageSaveComplete extensions/pl Category:PageSchemasRegisterHandlers extensions/pl Category:ParserFirstCallInit extensions/pl Category:Parser function extensions/pl Category:ResourceLoaderGetConfigVars extensions/pl Category:ScribuntoExternalLibraries extensions/pl Category:Search extensions/pl Category:SidebarBeforeOutput extensions/pl Category:SkinTemplateNavigation::Universal extensions/pl Category:Special page extensions/pl Category:Stable extensions/pl Category:Table extensions/pl Category:UploadComplete extensions/pl