FFXIV Wiki:Semantic MediaWiki

From Final Fantasy XIV Online Wiki
Jump to navigation Jump to search

Community portalHelp & editingStyle guideTo-Do ListHistorical


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_and_types

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

Setting 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

Property declaration

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 numberHas vendor value
Doomtrain Card440800
Lindwurm Card4411,500
Thundergust Griffin Card439500

Results Formats

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}}.