Support for Chemical Markup Language


Author: Eugene.Zelenko

Please allow uploading of files in Chemical Markup Language format (

There is also Java-based free software Jmol viewer ( for CML and extension for MediaWiki is already implemented ( Extension was implemented for 1.12 and some security concerns exists.

Version: unspecified
Severity: enhancement

bzimport added a subscriber: Unknown Object (MLST).
bzimport set Reference to bz16491.
bzimport created this task.Via LegacyNov 29 2008, 1:34 AM
Ilmari_Karonen added a comment.Via ConduitNov 29 2008, 10:21 AM

At a quick glance, it looks like the extensions may be exposing a bit too much of the nuts and bolts. IMHO, the ideal syntax for Wikimedia use would be similar to the <math> or <timeline> tags: just "<cml>CML MARKUP GOES HERE</cml>". There's no need to expose details like whether to use a signed or unsigned applet: such things are for the server admins to configure.

A CML/MDL media handler might be more convenient than a parser tag extension, anyway. Then you'd just upload the file and use it as if it were an image. From what I've seen, CML markup doesn't really look like something most people would want to edit by hand, at least no more so than SVG is.

Ilmari_Karonen added a comment.Via ConduitNov 29 2008, 12:51 PM

Anyway, it's definitely not ready for prime time, security-wise:

Platonides added a comment.Via ConduitNov 29 2008, 1:19 PM

Viewing the docs, javascript embedding is feature.
I think it should be rewritten as a media handler.

brion added a comment.Via ConduitNov 30 2008, 12:25 AM

I'd tend to agree on the media handler thing. The extension syntax seems much more verbose and complicated than it needs to be, and seems to be bloated up with random features like extra UI scripting.

That said I'd generally recommend against too many application-specific formats like this which will make it more difficult for third-party users of Wikipedia material to support stuff.

Please also consider issues with printing and non-Java fallback displays.

Ilmari_Karonen added a comment.Via ConduitNov 30 2008, 2:28 AM

The docs indicate it should be possible to run Jmol on the server side for static thumbnail generation. Alternatively, OpenRasMol might also be usable as a server side rasterizer.

In general, I think this should be treated a lot like the Cortado media player: users with Java get a nice little inline viewer, while the rest get a thumbnail and the ability to view the files using a browser plugin (like Chime) or download them for local viewing.

All that said, it does occur to me that there's one important difference between video clips and chemical structure data. Video files are "WYSIWYG"; they really only have one "normal" rendering, which the file format unambiguously specifies. Chemical structure data formats (like CML, MDL, PDB, etc.), on the other hand, generally just specify an abstract set of spatial data that can be rendered in a number of different ways. For RasMol-style renderers (which includes Jmol), this extra presentational information is effectively supplied via a scripting language that controls the viewer.

One possibility, if we want to go the media handler way, might be to add an extra "script=" parameter to the image link syntax, supporting a limited subset of the RasMol scripting language. Of course, we'd presumably have to parse the code and validate it, especially if we were to use it for server side rasterization. Even so, I'd prefer to use something based on RasMol script syntax rather than inventing our own, if only because people are likely to be familiar with it, and because there are probably tools out there that generate it. It's also pretty easy to read and edit,at least as long as you don't get too clever with it (which is about what one could say of wiki markup, too).

That said, both thumbnailing and scripting are really second-step features. The first step would be to get the media handler working at all.

bzimport added a comment.Via ConduitNov 30 2008, 4:27 PM

Eugene.Zelenko wrote:

May be CML support will complicate life of MediaWiki developers, but from other side it'll definitely simplify life of those who maintain chemistry related topics on Commons. Different representations of same molecule and views from different angles in different files could be avoided (see or as example).

Of course, chemistry is relatively small area in compare with Harry Potter, Pokemon, etc. :-) but definitely important one to justify support for special file format.

bzimport added a comment.Via ConduitFeb 13 2009, 10:11 PM

Gerard.meijssen wrote:

(In reply to comment #2)

Anyway, it's definitely not ready for prime time, security-wise:

This problem has been fixed. Thanks, GerardM

bzimport added a comment.Via ConduitNov 28 2010, 12:28 AM

nicove wrote:

I have started working again on the Jmol extension.

I agree that the media handler would be really nice, and a lot easier to use than the existing jmol tag.
Creating a media handler requires quite some work and to understand how MediaWiki code is working internally for several points. I decided to start with an easier solution, and to work on the media handler later.

I have worked on a tag much easier to use than the existing jmol tag. For example, you can now use <jmolFile>Chair.cml</jmolFile> to have access to a popup window containing a Jmol applet displaying the molecular file uploaded as File:Chair.cml.
Working example can be seen at

What do you think of this ?

I still want to add a few thing to this new tag : ability to use a preview image instead of a link (either generated on the server if I manage to do this, or using a static image), maybe allow a Jmol script to setup the display options, ...

Qgil added a comment.Via ConduitOct 30 2013, 8:27 PM

Should we think of this feature as a VisualEditor plugin?

bzimport added a comment.Via ConduitOct 30 2013, 8:43 PM

Eugene.Zelenko wrote:

If this will help to finally add visualization, you could do this :-)

But really this is data visualization, not editing. May be will be better to consider CML support as part of Media Viewer development?

Qgil added a comment.Via ConduitOct 30 2013, 10:19 PM

CCing Fabrice to weigh in ref Media Viewer.

Qgil added a comment.Via ConduitNov 27 2013, 4:52 PM

The Facebook Open Academy Program [1] is interested in this project, but we would need a technical mentor.


Rillke added a comment.Via ConduitNov 27 2013, 5:26 PM

(In reply to comment #12)
I could help with reviewing JavaScript (if you permit me) and also have some understanding of the requirements (Chemical markup, Wikipedia, Commons) but I am lacking PHP-skills as well general practice in MW-development. Let me know if I can help!

Qgil added a comment.Via ConduitNov 27 2013, 6:07 PM

Thank you for the offer, Rainer.

We still need to confirm the best approach to provide this feature. Currently this report is still sitting in MediaWiki/Unknown. CCing Multimedia devs to get more feedback.

bzimport added a comment.Via ConduitDec 1 2013, 3:45 PM

vladjohn2013 wrote:

Hi, this project is still listed at

Should this project be still listed in that page? If not, please remove it. If it still makes sense, then it could be moved to the "Featured projects" section if it has community support and mentors.

Rillke added a comment.Via ConduitMar 28 2014, 3:37 PM

[[:mw:User:Rillke/Chemical Markup support for Wikimedia Commons]]

JamesCrook added a subscriber: JamesCrook.Via WebFeb 10 2015, 5:38 PM
Qgil added a comment.Via WebFeb 11 2015, 1:44 PM

Wikimedia will apply to Google Summer of Code and Outreachy on Tuesday, February 17. If you want this task to become a featured project idea, please follow these instructions.

Rillke added a comment.Via WebFeb 11 2015, 10:23 PM

Wikimedia will apply to Google Summer of Code and Outreachy on Tuesday, February 17. If you want this task to become a featured project idea, please follow these instructions.

I guess security review (T66548) isn't carried out by a GSoC student?

Qgil edited projects, added Chemical-Markup; removed Possible-Tech-Projects.Via WebFeb 12 2015, 11:51 AM
Qgil set Security to None.
Restricted Application added a project: Multimedia. · View Herald TranscriptVia HeraldMar 26 2015, 11:37 AM
Rillke moved this task to File format support on the Commons workboard.Via WebMar 26 2015, 11:37 AM
Jdforrester-WMF moved this task to Backlog on the Multimedia workboard.Via WebSep 4 2015, 5:52 PM
Restricted Application added subscribers: Steinsplitter, Matanya, Aklapper. · View Herald TranscriptVia HeraldSep 4 2015, 5:52 PM
Jdforrester-WMF removed a project: Multimedia.Via Bulk EditSep 21 2015, 4:04 PM
zhuyifei1999 added a subscriber: zhuyifei1999.Via WebTue, Nov 3, 3:27 PM

Add Comment