Extension:LightweightRDFa

The Lightweight RDFa extension outputs simple semantic data in the RDFa form out of Mediawiki links. This extension provides part of the Semantic Mediawiki extension annotation (but does not depend on it). It is – as titled – a very lightweight and easy approach to create an RDFa-Enabled MediaWiki installation.

We follow Wikipedia's idea and allow free text for semantic annotation. For the semantic output we use:
 * The page URI as subject.
 * The annotated link targets as objects.
 * The predicate is created from the free text by removing the whitespace, transforming it in camel case form and putting it under the "$wgServer . $wgScriptPath . '/property/" namespace

Copying the exact SMW functionality through MediaWiki hooks only has some issues: Thus, to get out of beta phase, we are looking for either help for alternative hooks or help for alternative tokens
 * extracting annotations with '::' may break some cases for link pipes
 * The parser removes the leading ':' from a link so linkBegin hook cannot handle them (we use '^^' for now)

Configuration
For valid and well-formed RDFa you should also change the HTML DocType,

either HTML5 i.e.

or HTML v. <= 4 (default) i.e.

Examples
Using the OutputPageBodyAttributes hook we adjust the body element  In the article body we can write the following links property::Main Page => Main Page ^^property::Main Page => property::Main Page different text => different text different text => different text And we can get the following triple wiki:Links prop:property wiki:Main_Page