FANDOM


Semantic MediaWiki, or SMW, is, without fear of hyperbole, one of the coolest things ever to be added to the basic MediaWiki software.

It transforms the wiki into a truly relational database, with which you can actually use the data that the wiki has been collecting. SMW lets you actually ask questions of the wiki.

With it, you can get answers to questions like:

The questions you can ask are mostly limited by your imagination, and the infrastructure you're willing to add to the wiki.

Moreover all of SMW's output is dynamic. Thus, if you asked the system to tell you which stories were directed by Euros Lyn, it would automatically update Euros Lyn's page if he ever directed more episodes.

In short, SMW gives us the power to convert this wiki into a real database, but also to easily "futureproof" the accuracy of our articles.

A basic example Edit

Let's imagine that you wanted to know the names of the stories on which Stephan Pehrsson was the director of photography. In the past, your only real hope was going to Stephan's page and hoping that another editor had maintained the list of Stephan's contributions. Now, however you can type this simple command:

{{#ask:[[Category:Doctor Who (2005) television stories]] [[DOP::Stephan Pehrsson]]}}

To break this down, you're asking the database, within the category, Doctor Who (2005) television stories, in which did the property called "DOP" have a value of "Stephan Pehrsson"?

The answer? The Big Bang (TV story), A Christmas Carol (TV story), The Crimson Horror (TV story), Day of the Moon (TV story), Dinosaurs on a Spaceship (TV story), The Doctor, the Widow and the Wardrobe (TV story), A Good Man Goes to War (TV story), The Impossible Astronaut (TV story), The Pandorica Opens (TV story), The Snowmen (TV story), A Town Called Mercy (TV story)

Now, that'll get you your answer, but it's not very pretty. So let's quickly throw it into a more tabular form.

{{#ask:[[Category:Doctor Who (2005) television stories]] [[DOP::Stephan Pehrsson]]
| ? DOP
}}

The code | ? DOP creates a new column into which the property DOP is placed.

 DOP
The Big Bang (TV story)Stephan Pehrsson
A Christmas Carol (TV story)Stephan Pehrsson
The Crimson Horror (TV story)Stephan Pehrsson
Day of the Moon (TV story)Stephan Pehrsson
Dinosaurs on a Spaceship (TV story)Stephan Pehrsson
The Doctor, the Widow and the Wardrobe (TV story)Stephan Pehrsson
A Good Man Goes to War (TV story)Stephan Pehrsson
The Impossible Astronaut (TV story)Stephan Pehrsson
The Pandorica Opens (TV story)Stephan Pehrsson
The Snowmen (TV story)Stephan Pehrsson
A Town Called Mercy (TV story)Stephan Pehrsson

And that's a lot more readable. Not pretty, of course, but readable. We can then dress it up in all sorts of ways. But that involves knowing something about coding tables, which is a little off-topic for us now.

One thing that's easy to spot is that we've created a redlink. We haven't created the property DOP yet, so therefore we get a redlink. For the moment, we can sort of "paper over the crack" by simply unlinking the title. Let's also add in a header for the first column.

{{#ask:[[Category:Doctor Who (2005) television stories]] [[DOP::Stephan Pehrsson]]
| ? DOP
| headers = plain
| mainlabel = Episode name
}}

Making the headers plain and adding a mainlabel of "Episode name" results in this:

Episode nameDOP
The Big Bang (TV story)Stephan Pehrsson
A Christmas Carol (TV story)Stephan Pehrsson
The Crimson Horror (TV story)Stephan Pehrsson
Day of the Moon (TV story)Stephan Pehrsson
Dinosaurs on a Spaceship (TV story)Stephan Pehrsson
The Doctor, the Widow and the Wardrobe (TV story)Stephan Pehrsson
A Good Man Goes to War (TV story)Stephan Pehrsson
The Impossible Astronaut (TV story)Stephan Pehrsson
The Pandorica Opens (TV story)Stephan Pehrsson
The Snowmen (TV story)Stephan Pehrsson
A Town Called Mercy (TV story)Stephan Pehrsson

Truth is, though, you probably wouldn't want a table for something like this, because you really only have one variable — the name of the episode. If you wanted to put this dynamic list on the page Stephan Pehrsson, a simple list would do.

 
{{#ask:[[Category:Doctor Who (2005) television stories]] [[DOP::Stephan Pehrsson]]
| format = ul
}}

If we simply define format = ul, we'll get a bulleted list.

If we simply define format = ul, we'll get a bulleted list. Cool, huh? But there's still one unsatisfactory element. Our dab terms are showing. So how do we get rid of them so that we're just looking at pure titles? Easy. We force the output to run through {{dab away}}, our dab term stripper.

{{#ask:[[Category:Doctor Who (2005) television stories]] [[DOP::Stephan Pehrsson]]
| format = ul
| link = none
| template= dai
}}

Note here that we also have to set link = none simply because {{dai}} — which means dab away italics —  outputs a linked, italicized version of a raw name. So if you give it Castrovalva (TV story) it will give you Castrovalva . Stripping the links before you pass the data to {{dai}} is necessary, or you'd end up with [[Castrovalva (TV story)]].

The final result then is precisely what we want: a list that looks like any other list on any other page about a crew member. It's simple, bulleted, respects both {{TitleSort}} and {{dab away}}.

Best of all, if he comes back and does a new episode, we won't have to update the page. It'll be done for us. Automatically. Simple, perpetual accuracy.

How it works Edit

Before we go on to more advanced (read: fun) queries, let's stop for a moment to consider how this all works. What voodoo magic allows us to ask the wiki anything and expect an answer?

Basically, in order to get useful data back from the page, you have to change the way you link things. Imagine we add the following to a page:
[[DOP::Stephan Persson]]
This will mark that page as having the property of DOP equalling Stephan Pehrsson. So any time I look for that property value, that page will pop up.

Note, too, that there is no cosmetic difference between these two things:

[[Stephan Pehrsson]], the traditional link
and
[[DOP::Stephan Persson]], the SMW link

Both of these look the same way to anyone reading the page, even down to the mouseover. Stephan Pehrsson (normal) Stephan Pehrsson (SMW). See?

This doesn't mean that we have to go around to every page and start changing these links. To be fair, there are some times when manual editing might be required. But most of this can be handled easily by modifying a single template.

In this case, {{Wales crew}} — which appears on every BBC Wales-made programme — is hugely helpful. We can simply change the to output something like this:

[[producer::{{{producer}}]], [[director::{{{director}}}]], [[DOP::{{{DOP}}}]]
This globally converts all those links in the crew sections of BBC Wales pages from a sea of hundreds of tiny links into something you can really use.

The fun stuff Edit

Okay, let's move away from Stephan Pehrsson and his simple, one-variable question. If that's all SMW could do, it would be useful, but it wouldn't be much different from DynamicPageList.

The power of SMW is in combining properties so that intelligent questions can be asked.

Let's imagine that we could remember that Verity Lambert had an episode dedicated to her, but we couldn't remember which one. We could go to Verity Lambert/WhatLinksHere and scan through that massive list until we got to a new series episode. But that's pretty slow. Instead let's just do this:

{{#ask:[[Category:Doctor Who (2005) television stories]] [[dedication::Verity Lambert]]}}

That simple little statement gives us an answer in no time: Voyage of the Damned (TV story).

Wikis based on the new Unified Community Platform (UCP) may look or behave differently to what is described below.
See this page for more information on the new platform.

Extensions are features and add-ons developed for MediaWiki, the software platform that Fandom runs on. They are designed by Fandom staff or third-party developers for the purpose of either expanding the function of a wiki or overriding a built-in MediaWiki feature for customization purposes.

How to request an extension

First, verify that the extension you are looking for does not exist already on your community. You can check this by going to Special:Version and looking under the "installed extensions" section or checking the extension's parser function or tag against the "tags" and "hooks" section at the bottom of that page. Fandom already has a significant number of extensions enabled by default.

Many other extensions already exist in the Fandom codebase and can be enabled upon request. You can check what extensions Fandom offers later in this page. Some basic content tools, such as Variables, are automatically enabled by staff when requested. In the case of other complex extensions, such as DPL, a staff member will usually ask a few questions first to ensure that the extension you are asking for is in fact the ideal solution. Other extensions, where resulting site configuration may be dramatically changed (such as AbuseFilter), will be enabled at staff discretion depending on the context of the request.

If Fandom does not offer a particular extension, you may request Fandom engineering team investigate installing it by using Special:Contact and linking to the MediaWiki extension page along with some rationale as to why it's needed. Please be aware that the engineering team may take a few months to review the extension and that most extensions will be rejected. This is mainly due to the amount of rewriting an extension would require to live on the Fandom codebase servers. As such, it's always good to ask yourself, when looking at an extension on MediaWiki.org, whether the extension is up to date, is well-maintained, and allows for a caching layer. If the answer to any of these questions is no, chances are Fandom will not be able to install the extension.

Extensions active by default

Users and admins

Global CSS and JS
Adds global user CSS and JavaScript to a page, fetched from Community Central
Editcount
Displays edit count of a user

Wiki tools

CategoryTree
AJAX based gadget to display the category structure of a community
CharInsert
Allows creation of JavaScript box for inserting non-standard characters
Cite
Adds <ref[ name=id]> and <references/> tags, for citations
DPLforum
DPL-based forum extension using article pages.
EasyTimeline
Editors can create timelines of events using this tool's syntax.
GoogleDocs4MW
Adds <googlespreadsheet> tag for Google Docs' spreadsheets display
ImageMap
Allows client-side clickable image maps using <imagemap> tag
InputBox
Allow inclusion of predefined HTML forms
Math
Adds syntax for on-page math formulas
Maps Extension
Easily create Earth-based maps with wiki-fied markers
MultipleUpload
Allows users to upload up to 20 files at once
ParserFunctions
Enhance parser with logical functions
Poem
Adds <poem> tag for poem formatting
Polls
Set up single-choice polls
RandomImage
Provides a random media picker using <randomimage />
RandomSelection
Displays a random option from the given set
RSS Feed
Displays an RSS feed on a page
StringFunctions
Defines an additional set of parser functions that operate on strings
TabView and Tabber
Methods for having "tabbed" content
Video Embed Tool
Embeds videos from YouTube, Metacafe and many other sites
WikiHiero
Syntax to display hieroglyphs

Spam and blocking

AntiSpamInput
Simple spambot blocking mechanism
ConfirmEdit
Simple captcha implementation
TitleBlacklist
Regex based tool for blocking disruptive page titles

Other tools

ArticleMetaDescription
Adding meta-description tag containing snippet of the Article
MiniUpload
Allow users to upload new files directly from edit page
Shared Help
Provides the Help namespace pages from Community Central into all Fandom sites (controlled globally)
SiteWideMessages
Provides an interface for sending messages seen on all Fandom sites
SyntaxHighlight
Code syntax highlighter - supports many languages

Available on request

This is a non-comprehensive list of MediaWiki extensions that are available upon request at Fandom. See also "Extensions enabled on request" category.

Achievements
Add badges to users to encourage contributions
Calendar
Allows for embedding of a calendar into pages
Community JS
Allows for site JS (not including ImportJS)
Community Page
Provides a page for the community, to list things that need to be done on the wiki
DynamicPageList
Content listing tool, which adds the <dpl> tag
Gadgets
Creates and allows usage of "gadgets" for users
Recent Changes Patrol
Tells if edits conform to the policies of the wiki
Variables
Allows you to define a variable on a page then use it later in that same page
Loops
Provides parser functions for performing loops
Arrays
Provides parser functions that operate on arrays

Restricted extensions

These extensions have restricted access and administrators are only given access when there is a clear and current need for them.

AbuseFilter
Tool for automatically catching non-constructive edits.
CheckUser
Grants users with the appropriate permission the ability to check user's IP addresses and other information. (This is generally a staff-only tool, but a few administrators of big wikis also have access to it.)
Nuke
Gives VSTFs, Helpers, Managers and Staff members the ability to mass delete pages. (Wiki admins can also use the nuke script to mass delete pages by a specific user)
Protect site
Allows Fandom staff, Fandom Helpers, Wiki Managers and VSTF to temporarily block various site modifications (this is enabled as deemed needed. Local administrators of a wiki generally do not have access to it).
SpamBlacklist
Regex based anti URL spam tool
Semantic MediaWiki
No Longer requestable. Its "Help" page on this wiki redirects here, but discussion may be best confined to Semantic MediaWiki's official documentation site.

External links

Further help and feedback

Community content is available under CC-BY-SA unless otherwise noted.

Fandom may earn an affiliate commission on sales made from links on this page.

Stream the best stories.

Fandom may earn an affiliate commission on sales made from links on this page.

Get Disney+