User:DePiep/chembox/wikidata


 * (mostly 2016-17?)

=Chemical compounds and Wikidata=

Example: en:Carbon monoxide == Q2025

In Wikidata

 * Wiki poject site prefix:  for enwiki <=>   for Wikidata
 * Page content: "article" <=> "item"
 * Identifiers: en:Article <=> d:QID
 * Title: en:Pagename <=> d:en-label for QID
 * Property id: en: CASNo (infobox parameter) <=> d: P231 (property id for CAS number)
 * Property value: en: 630-08-0 <=> &rarr;


 * Chembox, Drugbox
 * d: single chemical


 * d:Wikidata:Glossary

local = in en:wiki, e.g. by parameter CASNo wd, d: in wikidata

Chemical compound data models

 * In Wikidata:
 * Chemical substance
 * can be
 * Chemical compound or
 * Ion or
 * Chemical element or
 * Mixture or


 * See also: d:Wikidata:WikiProject Chemistry

Article (title) can be
 * With Chembox
 * Single chemical compound
 * Multiple chemical compounds
 * Group (class) of chemical compounds -- Copaene

Article (title) can be
 * With Drugbox
 * Single chemical compound (most common)
 * Two chemical compounds
 * Vaccine (not a compound)
 * MAB (not a compound)
 * Combination of drugs (not a compound)

Link to the Wikidata item

 * The link in to the Wikidata page (item page)
 * demo here

Article has its corresponding item in Wikidata connected (QID)
 * All properties available

Articles that are not present in Wikidata (do not have an item in WD):

Local input, read another d:item that the natural one: Q999 &rarr; read d:item Q999


 * Provides the Wikidata link QID to view, edit.

Overview (item and QID)

 * Parameters involved:
 * (default) 'natural item', d:page (has QID)
 * QID locally set tioo us alternate item

''Note: these two settings are independent. One setting does not determine or influence the other one. However, we can combine them and apply logic.''
 * "Not a compound" situation will require attention. Issue in the data models (infobox, Wikidata)?
 * Multiple compound situation: use indexes.
 * Checks to do:
 * qidYes: (localQID needed) not a compound? other data issue?
 * qidYes: local QID is a compound?
 * qidYes: localQID = natural QID: remove (blank) localQID

Use ECHA InfoCard ID from Wikidata

 * Straightforward: when the article item has a value for Property P2566 ECHA Infocard ID, it is shown.



Use CAS number input from Wikidata

 * Template reads item-property P231 (CAS number):


 * can have QID set. In that case, that item's CAS number will be read:
 * QID=Q976 &rarr; CAS nr = ...

Overview (CAS)
Category:CAS from wd loc=/TRIVIAL Category:wd-CAS is not local-CAS!!

Category:CAS from wd loc0/TRIVIAL Category:CAS local value only!

Category:CAS not local not from wd


 * Add nac/not a compound?

Multiple compounds in one article (indexes)

 * One article can have multiple compounds.

In the infobox, these can be listed by using indexes. The first compound can be the article item (or the QID when set).

The other compounds require their own item (QID) being set. So for this one should use QID1 ... QID5


 * CASNo
 * PubChem


 * QID1
 * CASNo1
 * PubChem1


 * QID2
 * CASNo2
 * PubChem2


 * QID5
 * CASNo5
 * PubChem5

Note that each index is about one single compound. So stuff1 has CASnr1 and PubChem1.

The &lt;blank> values uses the article item value.

With that, CASNo1 and PubChem1 are read from QID1

Overview (indexed CAS)

 * Copaene

(indexed does not categorize: CAS number from Wikidata) wdCAS yes-->Category:CAS number (indexed) different in Wikidata wdCAS no -->Category:CAS number (indexed) not in Wikidata