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

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?

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.

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:

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= dab away

Note here that we also have to set link = none simply because {{dab away}} outputs a linked 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 {{dab away}} 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

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
[[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

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:

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. Other complex extensions, such as DPL, usually have a staff member ask a few questions 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 Abuse Filter), 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, 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.

List of extensions

Users and admins

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

Wiki tools

AJAX based gadget to display the category structure of a community
Allows creation of JavaScript box for inserting non-standard characters
Adds <ref[ name=id]> and <references/> tags, for citations
DPL-based forum extension using article pages.
Editors can create timelines of events using this tool's syntax.
Adds <googlespreadsheet> tag for Google Docs' spreadsheets display
Allows client-side clickable image maps using <imagemap> tag
Allow inclusion of predefined HTML forms
Allows users to upload up to 20 files at once
Enhance parser with logical functions
Adds <poem> tag for poem formatting
Set up single-choice polls
Provides a random media picker using <randomimage />
Displays a random option from the given set
RSS feed extension
Displays an RSS feed on a page
TabView and Tabber
Methods for having "tabbed" content
Video Embed Tool
Embeds videos from YouTube, Metacafe and many other sites, and adds Video pages
Syntax to display hieroglyph
Embeds YouTube and Google Video movies

Spam and blocking

Simple spambot blocking mechanism
Simple captcha implementation
Regular Expression Name Block
Alternate user block (by given name, using regular expressions, controlled globally)
Regular Expression Spam Block
Filters out unwanted phrases in edited pages, based on regular expression
Regex based anti URL spam tool

Other tools

Adding meta-description tag containing snippet of the Article
Allow users to upload new files directly from edit page
Allows drawing "shared" template messages from the shared DB
Shared Help
Provides the Help namespace pages from Community Central into all FANDOM sites (controlled globally)
Provides an interface for sending messages seen on all FANDOM sites
Code syntax highlighter - supports many languages

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.

Add badges to users to encourage contributions
Allows for embedding of a calendar into pages
Content listing tool, which adds the <dpl> tag
Maps Extension
Easily create Earth-based maps with wiki-fied markers
Recent Changes Patrol
Tells if edits conform to the policies of the wiki
Allows you to define a variable on a page then use it later in that same page
Provides parser functions for performing loops
Provides parser functions that operate on arrays
Defines an additional set of parser functions that operate on strings


Tool for automatically catching non-constructive edits. Added only if there is a clear and current need.
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.)
Protect site
Allows a site administrator to temporarily block various site modifications (this is enabled as deemed needed)
Semantic MediaWiki
Used on a few dozen FANDOM sites, including some of the biggest, but often problematic (due to performance and stability concerns) and 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

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.