Help:Cargo: Difference between revisions

2,781 bytes added ,  15 November 2024
→‎Features: Help:Class
No edit summary
(→‎Features: Help:Class)
 
(22 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Breadcrumbs|align=right|officialwebsite=no|page=Extension:Cargo}}
{{Breadcrumbs|align=right|officialwebsite=no|page=Extension:Cargo|mediawiki=yes|wikipedia=no}}


The Cargo MediaWiki extension is designed to enhance MediaWiki's capabilities by providing a structured way to store and query data within wiki templates, particularly useful for managing data in infoboxes or similar structured data representations.  
The '''Cargo''' [[MediaWiki]] extension is designed to enhance MediaWiki's capabilities by providing a structured way to store and query data within wiki templates, particularly useful for managing data in [[Template:Infobox|infoboxes]] or similar structured data representations.  


Cargo stands out as a powerful tool for those looking to leverage MediaWiki not just for content but for structured data management, offering a balance between complexity and usability for wiki administrators and developers. Its integration with MediaWiki's templating system makes it particularly useful for creating dynamic, data-driven content within wiki environments.
Cargo stands out as a powerful tool for those looking to leverage MediaWiki not just for content but for structured data management, offering a balance between complexity and usability for wiki administrators and developers. Its integration with MediaWiki's templating system makes it particularly useful for creating dynamic, data-driven content within wiki environments.
Line 15: Line 15:


==Features==
==Features==
*Data Types: Cargo supports various data types including simple types like strings, dates, and numbers, to more complex ones like hierarchies, coordinates, and wikitext.
 
*Special Pages: Cargo includes special pages like [[Special:CargoQuery]] for direct querying and [[Special:Drilldown]] for interactive data exploration.
=== Data Types ===
*Integration with MediaWiki: It integrates seamlessly with MediaWiki's existing structure, allowing for data to be linked with pages, categories, and other MediaWiki features.
{{Main|Help:Class}}
*Customization: Through settings like $wgCargoDefaultStringBytes or $wgCargoMaxQueryLimit, administrators can control how Cargo behaves in terms of data storage limits or query performance.
Cargo supports various data types including simple types like strings, dates, and numbers, to more complex ones like hierarchies, coordinates, and wikitext.
{| class="wikitable"
|-
!Field Type
!Description
!Unindexed?
|-
|<code>Page</code>
|Holds the name of a page in the wiki (default max size: 300 characters)
|
|-
|<code>String</code>
|Holds standard, non-wikitext text (default max size: 300 characters)
|
|-
|<code>Text</code>
|Holds standard, non-wikitext text; intended for longer values
|✔
|-
|<code>Integer</code>
|Holds an integer
|
|-
|<code>Float</code>
|Holds a real, i.e., non-integer, number
|
|-
|<code>Date</code>
|Holds a date without time
|
|-
|<code>Start date</code>,
<code>End date</code>
|Similar to <code>Date</code>, but are meant to hold the beginning and end of some duration. A table can hold either no <code>Start date</code> and no <code>End date</code> field, or exactly one of both.
|
|-
|<code>Datetime</code>
|Holds a date and time
|
|-
|<code>Start datetime</code>,
<code>End datetime</code>
|Work like <code>Start date</code> or <code>End date</code>, but include a time.
|
|-
|<code>Boolean</code>
|Holds a Boolean value, whose value should be 1 or 0, or 'yes' or 'no' (see [[Special:MyLanguage/Extension:Cargo/Querying data#Querying%20Boolean%20fields|this section]] for Cargo-specific information on querying Boolean values)
|
|-
|<code>Coordinates</code>
|Holds geographical coordinates
|
|-
|<code>Wikitext string</code>
|Holds a short text that is meant to be parsed by the MediaWiki parser (default max size: 300 characters)
|
|-
|<code>Wikitext</code>
|Holds longer text that is meant to be parsed by the MediaWiki parser
|✔
|-
|<code>Searchtext</code>
|Holds text that can be searched on, using the [[Special:MyLanguage/Extension:Cargo/Querying data#The%20%22MATCHES%22%20command|MATCHES]] command (requires MySQL 5.6+ or MariaDB 5.6+)
|
|-
|<code>File</code>
|Holds the name of an uploaded file or image in the wiki (similar to Page, but does not require specifying the "File:" namespace) (default max size: 300 characters)
|
|-
|<code>URL</code>
|Holds a URL (default max size: 300 characters)
|
|-
|<code>Email</code>
|Holds an email address (default max size: 300 characters)
|
|-
|<code>Rating</code>
|Holds a "rating" value, i.e., usually an integer from 1 to 5
|}
 
=== Special Pages ===
Cargo includes special pages like [[Special:CargoQuery]] for direct querying and [[Special:Drilldown]] for interactive data exploration.
 
=== Integration with MediaWiki ===
It integrates seamlessly with MediaWiki's existing structure, allowing for data to be linked with pages, categories, and other MediaWiki features.
 
=== Customization ===
Through settings like $wgCargoDefaultStringBytes or $wgCargoMaxQueryLimit, administrators can control how Cargo behaves in terms of data storage limits or query performance.


==Advantages==
==Advantages==
Line 35: Line 123:
* [[Special:CargoTables]]
* [[Special:CargoTables]]
* [[Special:Drilldown]]
* [[Special:Drilldown]]
==Map examples ==
===Table ===
{{#cargo_query:
tables=Employees
|fields=_pageName=Name,Location,Department
|format=table
}}
===Dynamic table ===
{{#cargo_query:
tables=Employees
|fields=_pageName=Name,Location,Department
|format=dynamic table
}}
===Open Layers===
{{#cargo_query:
tables=Employees
|fields=_pageName=Name,Location,Department
|format=openlayers
}}
===Leaflet===
{{#cargo_query:
tables=Employees
|fields=_pageName=Name,Location,Department
|format=leaflet
}}
== Related ==
* [[Help:Class]] - Defining a new Cargo template
* [[Help:Cargo (Overview)]]
* [[Help:Cargo (Query)]]


== Resources ==
== Resources ==
=== Links ===
=== Links ===
* https://workingwithmediawiki.com/book/chapter16.html
* https://community.fandom.com/wiki/Help:Cargo
* https://community.fandom.com/wiki/Help:Cargo
* https://community.fandom.com/wiki/Help:Cargo/recreating_tables
* https://community.fandom.com/wiki/Help:Cargo/recreating_tables
* https://community.fandom.com/wiki/Help:Cargo/customizing_tables
* https://community.fandom.com/wiki/Help:Cargo/customizing_tables
===Example wikis===
===Example wikis===
* https://lol.fandom.com/wiki/League_of_Legends_Esports_Wiki
See [[Help:Cargo (Example wikis)]]
* https://pathofexile.fandom.com/wiki/Path_of_Exile_Wiki
 
* https://eyewiki.org/Main_Page
=== Videos ===
** https://eyewiki.org/w/index.php?title=Intermediate_Uveitis&action=formedit
 
*https://www.wikilawschool.org/
{{Clear}}
**https://www.wikilawschool.org/w/index.php?title=Chevron_U.S.A.,_Inc._v._Nat._Res._Def._Council,_Inc.&action=formedit
==== Setting up Cargo on a Wiki Class ====
** https://www.wikilawschool.org/wiki/Template:Clerk-Note
{{#ev:YouTube|https://www.youtube.com/watch?v=9MHXrfCt5cM|400|left|Setting up Cargo on a Wiki Class (11 April 2024)}}
** https://wiki.oroboros.at/index.php?title=Robinson_2019_Am_J_Physiol_Cell_Physiol&action=formedit
 
====Cargo with the Neutronized Wiki====
{{#ev:YouTube|https://www.youtube.com/watch?v=n4rdTkaOrNc|400|left|Cargo with the Neutronized Wiki (May 20th, 2024)}}
[[Category:Help]]