Guidelines:Cargo

 is the extension uses to manage structured data.

Why Use Cargo?
Cargo allows us to re-use the same data on multiple different articles without duplicating it. For example, we use the data from the Upgrading page as folows:
 * On each Material article (e.g. Amber Relic), list all the item upgrades that require that Material.
 * On each item page (e.g. Wooden Shield), list all the upgrades of that item along with the Materials required to make it.

Without Cargo, we could only achieve this sort of thing by manually copy-pasting data on dozens of pages—hundreds for games like. This would be very difficult to maintain as any change to the data would have to be made on all the pages that duplicate it. With Cargo, we make the change on one page and it propagates to the other pages automatically.

uses Cargo instead of Semantic MediaWiki or Wikidata simply cause Cargo was the only option given to us by Gamepedia (and subsequently Fandom) at the time. We see no compelling reason to migrate.

Cargo at
You can browse 's Cargo data at Special:CargoTables.

For lists of templates which use Cargo to store or query data, and articles which use such templates, see Category:Cargo Extension.

Best Practices
All articles and templates should adhere to the following guidelines:

{{Do and Don't
 * Place all Cargo parser functions behind templates.
 * Place all Cargo parser functions behind templates.

List of Armor

 * Do not use  or any other Cargo parser function in articles directly.

List of Armor
}}

Every template using #cargo_query should:
 * Categorize pages in Category:Pages Querying Cargo Data
 * Be categorized in Category:Cargo Query Templates

Every template using #cargo_store should:
 * Categorize pages in Category:Pages Storing Cargo Data
 * Be categorized in Category:Cargo Storage Templates

Every Cargo template should also be documented in the data table at Category:Cargo Storage Templates.

Data Namespace
In most cases, stores Cargo data in the main namespace. Many list templates templates serve a dual purpose: they format lists or tables of data for one article, while also storing that data for use by other templates in other articles.

also has a dedicated Data namespace for storing certain data in a central location separate from any article. Only users in the curator group can edit pages in the Data namespace.

The Data namespace is used for datasets which:
 * are too large for a single wiki page to hold and need to be partitioned into several pages
 * need to be protected as they have a history of editors adding invalid input

Data:Translations meets both of these conditions and constitutes the vast majority of the data in the Data namespace. Most other data sets are small enough to be kept in mainspace articles and benefit from any editor being able to update them.

Module Data
also uses to store some structured data in Lua files using a JSON-like format. Cargo storage and Lua storage solve different problems.



 Problem: A template needs to associate inputs to pre-defined configuration data in order to generate output.

 

  Problem: Template A receives input on page X and Template B needs to re-use that data on page Y.



 Problem: A template needs to associate inputs to pre-defined outputs, where the outputs are large blocks of wikitext that are unwieldy when represented as Lua strings.



 Problem: Multiple templates need access to a data set that needs to be protected and/or is too large to store on a single wikipage.

 

Exporting Data
You are welcome to our Cargo data and use it however you see fit. However, if you redistribute our data, you must respect the terms of our GFDL License.

API
To app developers: we would be happy to have you use as a data source. Please join our and tell us about your project!

We strongly recommend that you do not use the directly in your critical path, as we cannot provide any guarantees on the availability or stability of our data. Instead, we recommend that you implement your own intermediate persistence layer that periodically grabs 's data.