Jump to content

Template talk:Chembox

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Local-image parser bug

[edit]

{{Chembox}} categorizes an article in Category:Chemical pages containing a local image if |ImageFile= (or similar field) is an image that is on the local wiki rather than on commons. However, Curium(III) chloride contains the local File:Curium(III) chloride.jpg but is not in the local-image category. It looks like a general bug when the filename contains a parenthesis: switching in other random enwiki images to that article sets the cat, and other chembox articles containing local images with parens does not set the cat. DMacks (talk) 16:48, 10 February 2025 (UTC)[reply]

Bug is in {{ParmPart}}, where {{#titleparts}} doesn't like some URL-encoded strings. It's a documented WP:NCTECHNICAL#Other problematic characters limitation of that parser function. Given we can't be sure how a filename will be passed, we should probably switch to {{string split}} instead of #titleparts or maybe just {{in string}} instead of ParmPart. DMacks (talk) 16:55, 10 February 2025 (UTC)[reply]

The {{Chembox Identifiers}} page has an error

[edit]

At the very beginning of the page {{Chembox Identifiers}} writes some code:

! colspan=2 style="background: #f8eaba;color:inherit; text-align: center;" |Identifiers |-

That code should not be visible on the page. It shows there is a code error. Please someone repair the error. Bernardirfan (talk) 18:45, 5 May 2025 (UTC)[reply]

[edit]

In the last few days I have noticed that the links for ECHA InfoCard no longer work, and give blank results. THis may be an error on ECHA's part. But the link from Wikidata works. EG https://echa.europa.eu/substance-information/-/substanceinfo/100.031.926 give blank info, but Wikidata's link https://www.echa.europa.eu/substance-information/-/substanceinfo/100.031.926 works as expected. So perhaps we need to add in "www." Graeme Bartlett (talk) 08:07, 20 July 2025 (UTC)[reply]

The problem has gone away, so was more likely outside of Wikipedia, perhaps in cloudfare or ECHA. Graeme Bartlett (talk) 21:59, 30 July 2025 (UTC)[reply]

Find articles that do **not** have InChIs, etc.

[edit]

Trying to look for info on this was unproductive on my end, so I gotta ask: is there an (easy?) way to get a list of articles with chemical (or drug) infoboxes that are missing e.g. an entry for the InChI or the IUPAC name?

Every once in a while, I can catch these while looking through entities on my personal list of interest, but it will surely be useful to easily find these articles with missing info so that I (or other people) can handle them. Haoresshin (talk) 03:42, 21 August 2025 (UTC)[reply]

WP:PetScan is one tool that can help. For example, [1] is a live search for "all mainspace pages that contain {{Chembox}} but do not have a link to International Chemical Identifier". That link is in the Chembox title for displaying the InChI value, so I'm using that as a proxy for not having that value. Another useful route is to visit and check the subcats of interest. It catches some missing fields (but not all, even among the standard ones) and some types of mistakes. DMacks (talk) 04:18, 21 August 2025 (UTC)[reply]
[2] is an improved search that "omits chemical-element pages". DMacks (talk) 01:35, 22 August 2025 (UTC)[reply]
Some tools I have used to fabricate SMILES and InChIs if it is not in Wikidata, ChemSpider or PubChem or other databases:
Generating SMILES/InChI(Key)s isn't a problem for me; in fact, one reason I have been doing these last few edits over the past few weeks is to test a utility I wrote for generating these identifiers, along with the (properly formatted!) IUPAC name. :) (One critique I have is that some of those web utilities are by default set to use "Kekulized" versions of the SMILES, when the version with aromaticity would be more appropriate, viz. C1=CC=CC=C1 vs. c1ccccc1 for benzene. Even worse ones neglect stereochemistry!)

Perhaps I'll release that utility publicly someday when I iron out most of its kinks and make it more user friendly...

Nevertheless, these links might be useful for other people reading this page, so thank you!

P.S. a SMILES representation of a monoclonal antibody would be too unwieldy to be useful, I agree, but one might still get away with computing the InChIKey, thus recalling its original intent as a hash for molecules. Haoresshin (talk) 05:46, 22 August 2025 (UTC)[reply]
And since you like fixing articles on drugs [3] is for infobox drug rather than chembox. (about 3 times more drugboxes). Graeme Bartlett (talk) 07:20, 22 August 2025 (UTC)[reply]