FFXIV Wiki:Semantic MediaWiki
Semantic MediaWiki ("SMW") is a MediaWiki extension used to store and query data. We use it throughout the wiki to store data for pages that can be displayed on other pages.
Documentation
Anyone interested in learning how to create and/or edit templates using SMW should review the official introduction. The SMW documentation is excellent, so most of the guidelines below include links to the official documentation.
Properties
Properties are the data fields stored by SMW. Examples of properties stored for various wiki pages include Has game icon (the icon associated with the wiki page) or Requires item (the item required by a quest, FATE, etc.).
Setting Property Values
Browsing Properties
To view the properties associated with a wiki page, click on the "Browse properties" link on the page. Each property will be displayed along with the value(s) stored for that wiki page. Properties that have not been created yet will be displayed in red. That can happen if a property is set on the page before the property is created, which should be avoided. If you see a red property, refer to "Creating New Properties" below.
Creating New Properties
New properties should be created very carefully, with as much specificity as possible. If you are unsure of whether or how to create a new property, reach out to other editors in Discord.
Editing Properties
Properties should be created very carefully to avoid requiring any future edits. If a property requires an edit, reach out in Discord for guidance.
Queries
"Ask" Queries - queries for multiple results
"Show" Queries - queries for a single page's data
Our templates often use SMW queries to display data related to other wiki pages. A basic SMW "ask" query (inline query used to display information from multiple pages) looks like this:
{{#ask:
<!--Query conditions-->
[[Category:Triple Triad Cards]]
[[Has patch::7.4]]
<!--Property values to be returned by the query, along with the page name-->
|? Has card number
|? Has game icon
}}
Result:
| Has card number | Has vendor value | |
|---|---|---|
| Doomtrain Card | 440 | 800 |
| Lindwurm Card | 441 | 1,500 |
| Thundergust Griffin Card | 439 | 500 |
Results Formats
To improve the appearance of query results, we generally use the "template" result format, which allows us to customize the display of the results. A variety of other result formats are available, including CSV files, result counts, etc.
Examples
To see examples of tables generated by SMW queries and formatted by a template, see {{Achievement list}} and {{Achievement table row format}}.