Wikipedia talk:Chemical infobox

From Wikipedia, the free encyclopedia
  (Redirected from Template talk:Chembox)
Jump to: navigation, search
WikiProject Chemistry (Rated Template-class)
WikiProject icon This page is within the scope of WikiProject Chemistry, a collaborative effort to improve the coverage of chemistry on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
 Template  This page does not require a rating on the project's quality scale.


Editors have brought up the idea of implementing a dynamic molecule viewer several times, most recently (as far as I'm aware) at

I recently stumbled across an open source project ( which could be useful for this. There is apparently a way to embed the viewer. Sizeofint (talk) 05:26, 28 April 2017 (UTC)

The site could also be useful for generating images of molecular models for infoboxes. Sizeofint (talk) 05:29, 28 April 2017 (UTC)

Request for help on cywiki[edit]

I've just copied over this template onto the Welsh (cy) Wikipedia. However, I have an error - the script is looking for a Template (or 'Nodyn') Chembox SystematicName, which I can't find. Any help please? Llywelyn2000 (talk) 15:18, 29 April 2017 (UTC)

Llywelyn2000 Is this still an issue? When I edit cy:Ffosffad and preview, there is no redlinked template listed below. -DePiep (talk) 14:47, 10 May 2017 (UTC)
You're right; the red link / missing template has gone. Problem solved! Just seen your edits too; many thanks! Llywelyn2000 (talk) 15:24, 10 May 2017 (UTC)
@DePiep: - Hi! There now appears the word value, instead of the actual values eg after '3DMet on cy:Amonia! I can't see any changes having been made to cause this. Any thoughts please? Llywelyn2000 (talk) 07:40, 20 July 2017 (UTC)
Will look into this. -DePiep (talk) 13:14, 20 July 2017 (UTC)
  • This happened. The section Identifiers is composed by {{Chembox Identifiers}}, which calls a subtemplate for each data row (for example subtemplate {{Chembox 3DMet}} to show input parameter |3DMet=)
Llywelyn2000 Recently, I changed that calling structure and parameter names.

Before (simplified code):

In [[Template:Chembox Identifiers]]
{{Chembox 3DMet | value={{{3DMet}}} }}
In [[Template:Chembox 3DMet]]
 {{!}} 3DMet {{!}} {{{value}}} <!-- data row in the wikitable -->


In [[Template:Chembox Identifiers]]
{{Chembox 3DMet | 3DMet={{{3DMet}}} }}
In [[Template:Chembox 3DMet]]
{{!}} 3DMet {{!}} {{{3DMet}}} <!-- data row in the wikitable -->
Somehow the cywiki got these versions mixed up (new Identifiers section template, old 3DMet subtemplate). That's why parameter {{{value}}} was unknown and showing as it did.
Solution: update the subtemplates called in {{Chembox Identifiers}} with the new enwiki code version like this. That's a dozen or so Template:Chembox Identifiers#Subtemplates used ... (Going back to old {{Chembox Identifiers}} code would take one edit, but could give unexpected effects).
Note: this only occurs in {{Chembox Identifiers}} not in other sections like {{Chembox Properties}}. I have created cy:Nodyn:Chembox/testcases (Identifiers tests). Ask more if anything is unclear. -DePiep (talk) 14:30, 20 July 2017 (UTC)
Compliments to Llywelyn2000 for making this work in cywiki! It's a very complicated and error-sensitive template (150+ templates...). -DePiep (talk) 14:30, 20 July 2017 (UTC)
Ooooh! How nice! And a BIG thanks to you for helping a small language wiki! I'm really grateful and will have a good look tomorrow. Llywelyn2000 (talk) 17:47, 20 July 2017 (UTC)
Getting there slowly! Most seem to have been done, apart from MeSH, as you can see here. Any ideas, please? Llywelyn2000 (talk) 05:43, 21 July 2017 (UTC)

DSD data but no GHS data[edit]

DSD/DPD data may be removed on 1 June 2017 when re-labelling and re-packaging of products already on the market has to be done. This, however, will lead to a loss of hazard and safety information. There are currently 934 articles with DSD data but without GHS data: hastemplate:Chembox -insource:/\| *HPhrases *= *\{/ insource:/\| *RPhrases *= *\{/
For several of these articles, information may get imported from de.wikipedia, especially from the 1384 articles with harmonised classification and labelling data incl. a link to the C&L inventory. --Leyo 13:34, 27 January 2017 (UTC)

What is the 'translation' from DSD into GHS? Or is it a different property? I don't get the relation. I mean, if DSD has to be removed on June 1, that is no loss right? -DePiep (talk) 13:46, 27 January 2017 (UTC)
Do the lead section of CLP Regulation and Template:Chembox Hazards answer your questions? --Leyo 14:04, 27 January 2017 (UTC)
That's a nice introduction. But you are giving me homework ;-), figuring out which changes (edits) to do. What I'm missing is a description of what to change in the {{Chembox}}, and in the individual articles. Let me try. When DSD is gone, we
  1. Remove |EUClass= from the infobox (like {{Hazchem T}})
  2. Use |GHSPictograms= (like {{GHSp|GHS04}})
  3. Use |HPhrases=, |RPhrases=, |PPhrases=, |SPhrases=
  4. The 1384 articles from de:wiki can be used to copy data from.
Is this it? -DePiep (talk) 11:47, 28 January 2017 (UTC)
Almost. To be removed:
  • |EUClass=
  • |RPhrases=
  • |SPhrases=
  • |RSPhrases=
To be filled with data:
  • |GHSPictograms=
  • |GHSSignalWord=
  • |HPhrases=
  • |PPhrases=
Harmonised classification and labelling means that a substance is listed in appendix VI, table 3.1 of CLP Regulation. --Leyo 00:04, 1 February 2017 (UTC)
Thanks. Looks like we (e.g. I) can make this a phased fade-over. Like, first categorise to-be-edited {{Chemboxes}}, to be made empty. Later more. -DePiep (talk) 08:21, 2 February 2017 (UTC)

Only less than one month to go … --Leyo 22:07, 8 May 2017 (UTC)

This is not as easy as suggested above, as the parameters have to have values coded in the right way, and the documentation is a blank. For GHSPictograms= there seems to be templates "GHS" followed by two digits that come up with suitable images. There is a "H-phrases" template that uses a list of three digit codes separated by pipes |. There is a "P-phrases" template that uses a list of three digit codes separated by pipes |. + can also be used between the three digit numbers. (There is also a GHS template that takes a part= parameter, also chapter section and annex parameters. Is this connected?) Can someone check that I did hydrogen peroxide conversion right? Graeme Bartlett (talk) 23:29, 8 May 2017 (UTC)
Looks good, except that IMHO a reference needs to be added. --Leyo 14:11, 11 May 2017 (UTC)
We could start with dedicated maintenance categories ('todo', 'done'). -DePiep (talk) 22:04, 9 May 2017 (UTC)
 Done created maint categories -DePiep (talk) 02:01, 10 May 2017 (UTC)
  • To be clear: there is no relation or connection between the old DSD and the new GHS sets. It's just: legally, per 1 June 2017 it must be GHS everywhere. -DePiep (talk) 19:09, 21 May 2017 (UTC)

The Wikidata route[edit]

  • New approach: how is the data quality for GHS in Wikidata? Could we simply read Wikidata values for this? -DePiep (talk) 16:41, 10 May 2017 (UTC)
    AFAIK the GHS data quality (and quantity) in Wikidata is week. A lot of manpower was invested in GHS data at de.wikipedia, i.e. the data quality is surely much better there. BTW: There is a table of harmonised entries in Annex VI to CLP that might be used. --Leyo 14:11, 11 May 2017 (UTC)
Then, Leyo 'we' could copy this data from dewiki into Wikidata. Then this enwiki can read it easily. I'd trust the dewiki quality in this. Of course there are bots that can do this copy/paste.
However. Many many editors do not trust a Wikidata value unless is has been sourced again by Wikidata. So they don't trust dewiki research in this. That's a huge opposition. Today {{Chembox}} does blindly import E number and ECHA from Wikidata. These are of minor importance, maybe GHS can do that route. -DePiep (talk) 21:18, 20 May 2017 (UTC)
If Wikidata is the choice, the Excel list linked above may be importer there. --Leyo 16:39, 21 May 2017 (UTC)
Thx. Technically obviously good. But as I said: Wikidata people don't trust our own wikis (not dewiki, not enwiki), so that's a hurdle. If and then, once uploaded, we need to convince enwiki people here that we can use that info in {{Chembox}}. Second hurdle. So I'm pessimistic.
I could try to start a village pump talk at Wikipedia, but I am low in battery myself. Maybe later. -DePiep (talk) 17:54, 21 May 2017 (UTC)

Todo list[edit]

Created categories per the above notes. See Category:Chembox DSD GHS changeover (2). -DePiep (talk) 02:01, 10 May 2017 (UTC)

Category:Chembox having DSD data (1,332)
Category:Chembox having GHS data (460)
To edit: Petscan: articles having DSD data an not having GHS data.
Initially: 1337 P (ca. 15 May 2017).
Example input (from ABCN):
| GHSPictograms = {{GHS flame}} {{GHS exclamation mark}}
| GHSSignalWord = Danger
| HPhrases = {{H-phrases|242|315|319|335}}
| PPhrases = {{P-phrases|261|305+351+338}}

| EUClass = {{Hazchem F}} {{Hazchem Xi}}
| RPhrases = {{R11}}, {{R36/37/38}}
| SPhrases = {{S26}}
Templates: Category:GHS templates, {{H-phrase text}}, {{H-phrases}}, {{P-phrase text}}, {{P-phrases}}.
-DePiep (talk) 13:18, 10 May 2017 (UTC)

I added having a sitelink to dewiki to the PetScan query. Hence, in most of these cases GHS data could be taken from dewiki. The difference in the source text there and here, however, does not allow for copy&paste. --Leyo 16:35, 12 May 2017 (UTC)

Notification in infobox[edit]

We could put a notification text in {{Chembox}} for by-then outdated DSD data, per 1 June 2017. That would be with |EUClass, RPhrases, SPhrases, RSPhrases= then. Example:

ABCN example
GHS pictograms The flame pictogram in the Globally Harmonized System of Classification and Labelling of Chemicals (GHS) The exclamation-mark pictogram in the Globally Harmonized System of Classification and Labelling of Chemicals (GHS)
GHS signal word Danger
H242, H315, H319, H335
P261, P305+351+338
Highly Flammable F Irritant Xi
R-phrases (outdated) R11, R36/37/38
S-phrases (outdated) S26
Using {{Chembox/DSD/warning note 2017 DSD-GHS}}

-DePiep (talk) 19:09, 21 May 2017 (UTC)

OK. BTW: CLP Regulation#Implementation could be linked. --Leyo 19:53, 21 May 2017 (UTC)
Link changed. And make logic: "When GHS data present, don't show old DSD at all"? -DePiep (talk) 21:32, 21 May 2017 (UTC)
DSD data should just be removed from the article as soon as GHS data is present. incategory:Chembox_having_GHS_data incategory:Chembox_having_DSD_data currently finds 178 affected articles. --Leyo 16:12, 22 May 2017 (UTC)
OK. Note: |RSPhrases= is also outdated data, so same treatment. -DePiep (talk) 08:32, 23 May 2017 (UTC)


Add warning to the four DSD data rows. (outdated)
When GHS data is present (any input, 4 parameters), old DSD data is not shown (4 parameters).
Tweaked the warning.
See /testcases10.
Affected, as of today: show warning ~1300 articles, hidden DSD data: ~178 other pages.
-DePiep (talk) 10:00, 23 May 2017 (UTC)
Okay, but I wasn't taking about hiding, but about removing the parameters from the source text of the affected articles (non-empty parameters if GHS data is present or empty parameters in any case). --Leyo 15:10, 23 May 2017 (UTC)
Trivial. (And: you did not talk about empty parameters in any case really). -DePiep (talk) 18:44, 23 May 2017 (UTC)
Yes, that is an additional aspect. --Leyo 21:57, 23 May 2017 (UTC)
Instead of just removing the empty DSD parameters, the GHS parameters (|GHSPictograms=, |GHSSignalWord=, |HPhrases=, |PPhrases=) might be added in the same bot run. --Leyo 08:15, 7 June 2017 (UTC)
Yes, read from the spreadsheet. But AFAIK there is no bot preparing.
I see two options: bot-import the spreadsheet in Wikidata (enwiki will read), or in the enwiki infobox. Depends on whether Wikidata people want to accept the dewiki research (wiki people are very reluctant with local wiki research, esp when no source is present). For enwiki, there is [[WP:BOTREQUEST}]. At the moment, I have no time or urge to start those requests. -DePiep (talk) 08:49, 7 June 2017 (UTC)


According to e.g. insource:/MainHazards *= *\{/ it seems that this parameter is partly used in a manner that was not foreseen. May we just remove such occurrences? --Leyo 15:10, 23 May 2017 (UTC)

"not foreseen" appears to be: data put here that could/should be elsewhere. SO: move to correct parameter is OK. I understand Main hazards to be verbose, and not stuff that is elsewhere. -DePiep (talk) 13:19, 30 May 2017 (UTC)