Difference between revisions of "Nookipedia:Project Database"
SuperHamster (talk | contribs) (Starting Cargo info) |
SuperHamster (talk | contribs) (→Cargo: Expanding example) |
||
Line 20: | Line 20: | ||
* All table and column names should be completely lowercase, with words being separated by an underscore. | * All table and column names should be completely lowercase, with words being separated by an underscore. | ||
* All table and column names should be singular, not plural. An exception is when a column's values are lists (e.g. a column that holds arrays of materials may be called <code>materials</code>). | * All table and column names should be singular, not plural. An exception is when a column's values are lists (e.g. a column that holds arrays of materials may be called <code>materials</code>). | ||
− | * Values should be plain text (no HTML or | + | * Values should be plain text (no HTML or wikitext), unless that column is explicitly being used for display. |
** This is so that the data can be queried elsewhere (on both the wiki and externally) without having to worry about formatting issues. | ** This is so that the data can be queried elsewhere (on both the wiki and externally) without having to worry about formatting issues. | ||
− | ** | + | ** Example 1: [[Special:CargoTables/nh_furniture|nh_furniture]] has columns <code>buy1_price</code>, <code>buy1_currency</code>, and <code>buy1_wikitext</code>. The first two hold an integer and string respectively; the last one holds the value inside of [[Template:Currency]], for easy reference on the wiki. |
+ | ** Example 2: In [[Template:NHFishInfo]], the <code>catchphrase</code> parameter stores the catchphrase as a normal string, while <code>catchphrase-display</code> stores the catchphrase with any included HTML. The [[Special:CargoTables/nh_fish|nh_fish]] Cargo table stores the former, while the template displays the latter. | ||
===List of tables=== | ===List of tables=== |
Revision as of 05:16, August 8, 2020
Welcome to Project Database, the Nookipedia Project dedicated to establishing and maintaining a database covering the Animal Crossing series.
Cargo
Nookipedia uses Cargo, a MediaWiki extension that provides a way to store data from templates into a database. This means that we can define data about a subject in just one location, and then re-use it across the wiki through querying. It also enables external users to re-use our data, through api.nookipedia.com and other services.
Basics
On the wiki, editors can interact with Cargo through parser functions:
#cargo_declare
- Defines the schema for a table. Placed within thenoinclude
part of a template.#cargo_store
- Stores one row of data to a Cargo table. Placed within theinclude
part of a template.#cargo_query
- Queries Cargo data tables, using SQL components.#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.
For full usage documentation, see mw:Extension:Cargo/Storing data and mw:Extension:Cargo/Querying data.
Best practices
- All table and column names should be completely lowercase, with words being separated by an underscore.
- All table and column names should be singular, not plural. An exception is when a column's values are lists (e.g. a column that holds arrays of materials may be called
materials
). - Values should be plain text (no HTML or wikitext), unless that column is explicitly being used for display.
- This is so that the data can be queried elsewhere (on both the wiki and externally) without having to worry about formatting issues.
- Example 1: nh_furniture has columns
buy1_price
,buy1_currency
, andbuy1_wikitext
. The first two hold an integer and string respectively; the last one holds the value inside of Template:Currency, for easy reference on the wiki. - Example 2: In Template:NHFishInfo, the
catchphrase
parameter stores the catchphrase as a normal string, whilecatchphrase-display
stores the catchphrase with any included HTML. The nh_fish Cargo table stores the former, while the template displays the latter.
List of tables
A full up-to-date list of tables (and their associated declare/attachment templates) is available at Special:CargoTables.
The following table lists tables, descriptions, and their status. Note that this table is manually updated,
Production: This table's structure is finalized, and has been fully populated with data. It can reliably be used for querying on-wiki or externally. | |
Beta: This table is approaching completion. Structure is near finalized, and/or nearly all data has been populated. | |
Dev: This table is brand new. Columns may be added, removed, or changed, and/or is still missing a lot of data. |
Table | Description | Status | API [nb 1] | Notes |
---|---|---|---|---|
nh_fish | Animal Crossing: New Horizons fish | Queried by Nookipedia API. Missing rarity data (common name for rarity percentages has to be determined). | ||
nh_bug | Animal Crossing: New Horizons fish | Queried by Nookipedia API. Missing rarity data (common name for rarity percentages has to be determined). | ||
nh_sea_creature | Animal Crossing: New Horizons sea creatures | Queried by Nookipedia API. Missing rarity data (common name for rarity percentages has to be determined). |
Helpful links
General
Inputting data
Retrieving data
Notes
- ↑ A check in the API column indicates that the table is queried via api.nookipedia.com
Nookipedia | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|