Help:Cargo: Difference between revisions
Jump to navigation
Jump to search
Line 16: | Line 16: | ||
==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. | *Data Types: 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 | |||
| | |||
|- | |||
| colspan="3" | | |||
|- | |||
|<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. | |||
| | |||
|- | |||
| colspan="3" | | |||
|- | |||
|<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. | *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. | *Integration with MediaWiki: It integrates seamlessly with MediaWiki's existing structure, allowing for data to be linked with pages, categories, and other MediaWiki features. |
Revision as of 22:12, 15 September 2024
|
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.
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.
Functionality
- Data Storage: Cargo allows data to be stored in database tables, which can be either within MediaWiki's database or in a separate database for performance or security reasons. This data is typically derived from template calls, where each template invocation can define a row in a table.
- Querying Data: Users can query this data using SQL-like syntax through special pages or parser functions provided by Cargo, like #cargo_query. This allows for dynamic content generation based on the data stored.
- Parser Functions:
- cargo_declare: Defines the schema for a table, placed within the <noinclude> part of a template.
- cargo_attach: Specifies that a template adds rows to a table declared elsewhere.
- cargo_store: Stores data into a Cargo table, usually within the <includeonly> part of a template.
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.
Field Type | Description | Unindexed? |
---|---|---|
Page
|
Holds the name of a page in the wiki (default max size: 300 characters) | |
String
|
Holds standard, non-wikitext text (default max size: 300 characters) | |
Text
|
Holds standard, non-wikitext text; intended for longer values | ✔ |
Integer
|
Holds an integer | |
Float
|
Holds a real, i.e., non-integer, number | |
Date
|
Holds a date without time | |
Start date ,
|
Similar to Date , but are meant to hold the beginning and end of some duration. A table can hold either no Start date and no End date field, or exactly one of both.
|
|
Datetime
|
Holds a date and time | |
Start datetime ,
|
Work like Start date or End date , but include a time.
|
|
Boolean
|
Holds a Boolean value, whose value should be 1 or 0, or 'yes' or 'no' (see this section for Cargo-specific information on querying Boolean values) | |
Coordinates
|
Holds geographical coordinates | |
Wikitext string
|
Holds a short text that is meant to be parsed by the MediaWiki parser (default max size: 300 characters) | |
Wikitext
|
Holds longer text that is meant to be parsed by the MediaWiki parser | ✔ |
Searchtext
|
Holds text that can be searched on, using the MATCHES command (requires MySQL 5.6+ or MariaDB 5.6+) | |
File
|
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) | |
URL
|
Holds a URL (default max size: 300 characters) | |
Email
|
Holds an email address (default max size: 300 characters) | |
Rating
|
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
- Ease of Use: Compared to other extensions like Semantic MediaWiki, Cargo might be simpler to install and use for basic to intermediate data management needs within MediaWiki.
- Performance: By potentially using a separate database, Cargo can help in managing performance issues related to data queries, especially on large wikis.
- Flexibility: Its design allows for complex data structures and queries, making it suitable for wikis where structured data management is crucial.
Community and Development
- Development: Cargo has seen contributions through programs like Google Summer of Code, indicating active development and community involvement.
- Support: There's community support through forums, documentation, and the MediaWiki extension repository, where users can find help or contribute to its development.
Special pages
Map examples
Table
Name | Location | Department |
---|---|---|
Bryan | 38.89814, -77.03666 | IT |
Josh | 41.90218, 12.45393 | European Sales |
Juanita | 40.71181, -74.01337 | Marketing |
Mary | 32.70663, 35.30482 | HR • Marketing |
Peter | 38.8977, -77.03655 | HR |
Dynamic table
Name | Location | Department |
---|---|---|
Name | Location | Department |
Bryan | 38.89814, -77.03666 | IT |
Josh | 41.90218, 12.45393 | European Sales |
Juanita | 40.71181, -74.01337 | Marketing |
Mary | 32.70663, 35.30482 | HR • Marketing |
Peter | 38.8977, -77.03655 | HR |
Open Layers
Leaflet
Related
- Help:Class - Defining a new Cargo template
Resources
Links
- https://community.fandom.com/wiki/Help:Cargo
- https://community.fandom.com/wiki/Help:Cargo/recreating_tables
- https://community.fandom.com/wiki/Help:Cargo/customizing_tables