Visual Editor and Semantic MediaWiki

From semantic-mediawiki.org

One major change in MediaWiki is the new visual editor ("VE") that has been developed since 2011 and as of spring 2015 still has some way to go. This page is intended to collect information for the particular question of installing and running VE simultaneously with Semantic Mediawiki (SMW).

Note: As usual everybody is welcome to contribute. Having created this page upon a suggestion on the SMW mailing list in 03/2015 I will be looking frequently on it for the coming weeks and try to make it a helpful resource. I am by no means a VE specialist, yet you are welcome to post questions etc. that might help to enhance this page on the talk page of this article. This note will be removed in 05/2015. Oleander Hans (talk)

Installation[edit]

It is certainly helpful to read about VE to better understand what this fairly complex and powerful module does and how it works. Installation is possible via git or downloaded archives (as usual). It involves more work than just getting some files/directories and adding one statement to LocalSettings.php; in particular providing node.js/parsoid support. As for the latter it probably does not make sense to create a new place here to document and discuss the installation of these. However if one gets stuck at that point do not let this be a reason to not continue. Contact the MW mailing list, the talk page or Hans and help might be found. One can argue that SMW users should be encouraged to become early adopters and contribute their insights and opinions on the further development of this tool, being a particular yet important part of the MW community.

All together the process is well documented. It seems recommendable to use at least MW version 1.24. In order to get the latest master branch of VE (e.g. introducing table editing capabilities) to work MW 1.25 is required. It is necessary to check and obey compatibility requirements of the VE extension page. E.g. as of march 2015 VE latest 0.1.0 version does not support current stable MW 1.24.1 version but requires a late alpha build of MW 1.24.

Working configuration[edit]

The following configuration has been found operational, feel free to add more

  • MW 1.24.1 (1eb9951), VE 0.1.0 (af11aa1), SMW 2.1.1, Semantic Forms 3.2 (2a9064b), Semantic Result Formats 1.9

Running VE with SMW[edit]

VE will always edit entire page[edit]

VE will reconfigure both the edit tab on top of the page and the edit links behind captions on that page. Clicking on any of these will always put the entire page into VE mode (so not just the corresponding section, in case of links behind captions). In both places (a tab at page head and a link behin caption) a new option "edit source" becomes available that allows to edit the wiki markup source.

Table editing[edit]

Existing tables, i.e. the content of cells, can be edited with VE. Editing the table structure (adding lines etc.) can only be done with a VE version 0.1.0 based on MW 1.25 or higher, otherwise the functionality is not available.

Templates and other elements not having the text source on the edited page[edit]

VE cannot and should not change content whose source is not available on that page. Hovering the mouse over such content will highlight the entire block; clicking on it will accordingly not place a write cursor but rather display a small popup with a jigsaw puzzle icon and the wiki command that is responsible for the content displayed, e.g. a self implemented parser function #myfunction or in case of SMW a #ask [[property::value]]... statement.

VE recognizes and supports named parameters within such commands or fields by generating an edit form in a popup window. Most prominent example is templates. A page containing a template call including a named parameter "Year", e.g. ...|Year=2015|... will make that field "Year" editable within the popup that appears when clicking on the jigsaw puzzle icon.

Semantic Forms[edit]

A semantic forms (SF) page often consists of one or more template calls and a free text area. With VE installed the page has three edit tabs: "edit", "edit source" and "edit with form". While one could envision a GUI scenario where the form/template part is handled and rendered by SF and the freetext part by VE, this is unlikely to be the case at least in the near future.

The main issue is that VisualEditor - unlike WikiEditor, FCKeditor and the rest - is intended as a complete framework for editing a page; it lacks the ability to only edit part of a page. There's actually a feature request for that: https://phabricator.wikimedia.org/T50429. If you read that page, there's quite a long discussion about it, and Semantic Forms is mentioned a few times. (Yaron Koren to SMW mailing list, March 23, 2015)

As a result one currently can

  1. (edit the wiki source, of course)
  2. use VE to edit a SF page. Use VE's popup form to edit the template part of the page, which is fine for simple things like short strings, but obviously deprives you of features such as date picker, semantically predefined dropdown selections and many more. However in the freetext area you can enjoy VE
  3. use SF to edit a page. For the freetext area the "old" wiki editor will be your tool while in the form area you continue to have the full SF feature set.