Extension:ReorderParserPhases

work with
MediaWiki 1.22-1.23 Optional Semantic MediaWiki 1.18 - 1.19

Purpose
This extension allow the user to perform complex queries and commands, using MediaWiki built in parser functions, templates, and magic words that require several stages. The ReorderParserPhases extension allows the user to control the operators (parser functions, templates, and magic words) execution order.

case 1: Edit input and operators inside parser functions
expr = evaluates a mathematical expression and returns the calculated value.

6 =

6 = =

3*3 =

9 = =

6 = =

case 2:Create complex semantic parser function
Semantic Mediawiki parser function

Data is taken from and. You can test the extension by exporting those pages from and importing them into your wiki. Then after installing ReorderParserPhases create a test page and copy the code below to its wiki source code.

It is possible nest parser (and semantic parser) functions without the using ReorderParserPhases. However because all parser functions was the same separator | for their parameters, it could lead to confusion. For complex queries it becomes unclear to which parser function each parameter is referring to. In addition the order of parser function evaluation is different in different versions of SMW, which can cause the code to produce different results and different from that to which way the user. The ReorderParserPhases extension solves all of these problems. Using ReorderParserPhases the user can easily write simple clear (understandable) and unambiguous code.

Cities in germany
Cities in germany = multiValuePropFromStrudelAsk1 =

Demo:Berlin, Demo:Cologne, Frankfurt, Munich, Stuttgart =

Cities with more then 3 km2
Cities with more then 3 km2 = multiValuePropFromStrudelAsk2 =

Demo:Berlin, Demo:San Diego, France, Munich, Porto, Warsaw =

And
multiValuePropFromStrudelAskAnd =

Demo:Berlin, Munich =

multiValuePropFromStrudelAskAnd =

Or
multiValuePropFromStrudelAskOr =

Demo:Berlin, Demo:Cologne, Demo:San Diego, France, Frankfurt, Munich, Porto, Stuttgart, Warsaw =

multiValuePropFromStrudelAskOr=

See similar extensions
Extension:ParserPhase2

Extension:Lua