Extension:Wiki Object Model

Wiki Object Model (WOM) is a set of classes and API to allow easy and flexible manipulation of wiki page content at a fine granularity, by other extensions, bots, or external programs via API.

The name and idea is similar to DOM and Page Object Model (POM), but WOM provides greater control and more power. The name shows the similarity of concepts to POM and DOM.

WOM supports various objects that MediaWiki supports, such as Section, Link, Template, Parser Functions, Category, and so on. WOM allows users to identify and access objects via xpath (API) and object hierarchy, and further operate on them.

WOM is an open architecture that anyone can add more functionality into it.

Requirements

 * MediaWiki 1.13.5 or greater
 * Semantic MediaWiki 1.4.3 or greater
 * PHP 5.x or greater installed and working
 * MySQL >= 4.0.14 (version required by MediaWiki)

WOM overview
WOM will parse through the wiki page and convert the wiki text into an object hierarchy, with support of recursion. That is to say, if a page contains sections that contains another subsection, which contains a template whose parameter is another template, WOM allows users to manipulate any object in the chain.

The parsed wiki text can be traversed like a graph, it can also be exported as an XML data via API.

WOM uses its underline Object Model (extensible) to allow many functions.

WOM's API enables external application to read/write into wiki pages with greater flexibility.

What WOM can do?

 * To locate specified Wiki object with Wiki DOM technique, especially xpath series
 * To create Wiki objects based on Wiki text
 * To edit Wiki page simply by updating Wiki objects
 * Operating on Wiki objects instead of parsing wiki text
 * To support various MediaWiki objects, e.g., templates, links, properties, etc.
 * Easy to add support of new type of Wiki objects
 * API support for third party applications to read/modify Wiki pages

What WOM CANNOT do?

 * WOM does a best-effort parsing of MediaWiki text.
 * Not all de-facto MW markup syntax is supported, so there could be parse errors when malformed wiki text is encountered
 * but most well-formed syntax is supported
 * Transclusion with parameters or variables is not supported
 * can not be parsed to 'yes'
 *   will not return correct 'Template Object model':
 * Only plain transclusion (whole page transclution) is supported

Wiki Object Models
WOM Object Models

WOM Functions
WOM functions

WOM Apis
WOM Apis

Similar extensions

 * Extension:Page Object Model
 * Extension:Semantic Forms/POM

Extensions based on WOM

 * Extension:Semantic Page Maker

Development guide
WOM development guide